<template>
	<view class="page">
		<headerinfo></headerinfo>
		<!-- <headertop :inv="5"></headertop> -->
		<backos></backos>
		<!-- <u-navbar title="账号与安全" :placeholder="true" :autoBack="true"></u-navbar> -->
		<view class="changeMy">
			<u-cell title="手机号" @click="toPage(`/pages/changeMy/editmyphone?phone=${realphone}`)" :isLink="true" :value="phone"></u-cell>
			<u-cell title="修改密码" @click="toPage(`/pages/changeMy/editmypwd`)" :isLink="true"></u-cell>
		</view>
	</view>
</template>

<script>
export default {
	components: {},
	data() {
		return {
			phone:'',
			realphone:""
		};
	},
	onShow() {
		this.getData()
	},
	methods: {
		getData(){
			uni.showLoading({
				title:'加载中...'
			})
			this.$api.myInfo().then(res=>{
				this.realphone = res.phone;
				this.phone = res.phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
				uni.hideLoading()
			})
		},
		toPage(url) {
			console.log(url);
			uni.navigateTo({
				url
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.changeMy {
	border-top: 1px solid #f8f8f8;
	background-color: #fff;
	margin-top: 20rpx;
	width: 600px;
	margin: 0 auto;
	    border: 1px solid #f8f8f8;
	    box-shadow: 0 0 3px #ccc;
		border-radius: 20rpx;
}
</style>
